<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:arp="http://www.arptek.ru/arp-ns" xmlns:i18n="http://www.arptek.ru/i18n" version="1.0">
    <xsl:output doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" encoding="Windows-1251" indent="no" media-type="text/html" method="html"/>
    <xsl:template match="text()|@*"/>
    <!-- ????? ?? ???????????? ?????? -->
    <!--?
        -tree
?-->
    <!-- ??????? ?????? ?????? ?? ???????? ????????? -->
    <arp:module flat="false" name="custom_xsl_for-path" select="//site[@active='true']/..//*[@active='true']" type="xpath"/>
    <!-- ??????????? ?????????? ???????? ????? -->
    <xsl:variable name="site" select="/*/arp:module[@name='custom_xsl_for-path']//site[@active='true']"/>
    <!-- ??????? ?????? -->
    <arp:module format="old" select="//site[@active='true']/search" type="search"/>
    <!-- ??? ???? ???????? - ??????? ???? ???????? ? ????? -->
    <!--?
        links 76056 1
        links 61805 1
        links 61810 1
        links 61814 1
        links 61824 1
?-->
    <!-- ????????? ??????? -->
    <arp:module count="1" name="random_person" select="//*[@cell='92927']/folder[@state='published' and @cell != '92855']/*[@state='published'][file[@name='foto']]" type="random"/>
    <!-- ????????? ??????? -->
    <xsl:param name="leftwidth">180</xsl:param>
    <xsl:param name="centerwidth">560</xsl:param>
    <xsl:param name="rightwidth">180</xsl:param>
    <xsl:param name="showComments">0</xsl:param>
    <xsl:template match="/">
        <xsl:param name="drawOnlyTopBottom">0</xsl:param>
        <xsl:param name="contentName">
            <xsl:value-of select="/*/name"/>
        </xsl:param>
        <xsl:param name="contentDescription">
            <xsl:value-of select="/*/description"/>
        </xsl:param>
        <html>
            <xsl:call-template name="Header">
                <xsl:with-param name="contentName" select="$contentName"/>
                <xsl:with-param name="contentDescription" select="$contentDescription"/>
            </xsl:call-template>
            <body bgcolor="white" bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" topmargin="0">
                <xsl:if test="$drawOnlyTopBottom=0">
                    <a name="top"/>
                    <xsl:call-template name="Counters"/>
                    <xsl:call-template name="FirstPart"/>
                    <xsl:call-template name="SecondPart"/>
                    <xsl:call-template name="ThirdPart">
                        <xsl:with-param name="contentName" select="$contentName"/>
                        <xsl:with-param name="contentDescription" select="$contentDescription"/>
                    </xsl:call-template>
                </xsl:if>
                <xsl:if test="$drawOnlyTopBottom!=0">
                    <a name="top"/>
                    <xsl:call-template name="Counters"/>
                    <xsl:call-template name="FirstPart"/>
                    <xsl:call-template name="SecondPart"/>
                    <xsl:call-template name="drawContentTemplateBox">
                        <xsl:with-param name="contentName" select="$contentName"/>
                        <xsl:with-param name="contentDescription" select="$contentDescription"/>
                    </xsl:call-template>
                    <xsl:call-template name="Footer"/>
                </xsl:if>
            </body>
        </html>
    </xsl:template>
    <xsl:template name="Header">
        <xsl:param name="contentName">
            <xsl:value-of select="/*/name"/>
        </xsl:param>
        <xsl:param name="contentDescription">
            <xsl:value-of select="/*/description2s"/>
        </xsl:param>
        <head>
            <meta content="ru" http-equiv="Content-Language"/>
            <meta content="{/*/keywords}" name="keywords"/>
            <title>
                <xsl:if test="string-length($contentDescription)!=0">
                    <xsl:value-of select="$contentName"/>: <xsl:value-of select="$contentDescription"/>
                </xsl:if>
                <xsl:if test="string-length($contentDescription)=0">
                    <xsl:for-each select="$site">
                        <xsl:call-template name="writeLastActiveName">
                            <xsl:with-param name="current" select="/*/name"/>
                        </xsl:call-template>: <xsl:value-of select="$contentName"/>
                    </xsl:for-each>
                </xsl:if>
            </title>
            <xsl:call-template name="css"/>
        </head>
    </xsl:template>
    <xsl:template name="writeLastActiveName">
        <xsl:param name="current"/>
        <xsl:if test="count(*[@active='true'])=0">
            <xsl:choose>
                <xsl:when test="@name=$current">
                    <xsl:value-of select="../@name"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="@name"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:if>
        <xsl:if test="count(*[@active='true'])!=0">
            <xsl:for-each select="*[@active='true']">
                <xsl:call-template name="writeLastActiveName">
                    <xsl:with-param name="current" select="$current"/>
                </xsl:call-template>
            </xsl:for-each>
        </xsl:if>
    </xsl:template>
    <xsl:template name="css">
        <!-- link type="text/css" rel="stylesheet" href="ifs://171666"/ -->
        <style type="text/css"><![CDATA[
BODY{ MARGIN: 0px; BACKGROUND-COLOR: WHITE;}

H1 {FONT-WEIGHT: bold; FONT-SIZE: 200%; COLOR: #006699; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 18px; PADDING-LEFT: 18px; TEXT-ALIGN: center; }
H2 {FONT-WEIGHT: bold; FONT-SIZE: 120%; COLOR: #005588; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 15px; PADDING-LEFT: 15px; TEXT-ALIGN: center; }
H3 {FONT-WEIGHT: bold; FONT-SIZE: 100%; COLOR: #004477; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 12px; PADDING-LEFT: 12px;  }
H4 {FONT-WEIGHT: bold; FONT-SIZE: 90%; COLOR: #003366; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 9px; PADDING-LEFT: 9px; TEXT-ALIGN: center; }
H5 {FONT-WEIGHT: bold; FONT-SIZE: 80%;   COLOR: #002255; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 6px; PADDING-LEFT: 6px; }
H6 {FONT-WEIGHT: bold; FONT-SIZE: 70%;   COLOR: #001144; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; }

B {FONT-WEIGHT: bold; }

P {PADDING-RIGHT: 3px; PADDING-LEFT: 3px; TEXT-INDENT: 8mm; }

TD {TEXT-INDENT: 0mm; FONT-SIZE: 80%; FONT-WEIGHT: normal; FONT-FAMILY: verdana, arial, helvetica; }
.td {TEXT-INDENT: 0mm;}
UL {LIST-STYLE-TYPE: square}

.MenuTable {}
.MenuTitle {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #003366; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; TEXT-ALIGN: center; BACKGROUND-COLOR: #F6DDDD;}
.MenuItem { FONT-VARIANT: small-caps; TEXT-ALIGN: center; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-ALIGN: center;
PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px;}
A.menu {}
A.menu:hover { TEXT-DECORATION: underline }

p.News {TEXT-ALIGN: justify;  FONT-SIZE: 100%; MARGIN-TOP: 1px; CLIP: rect(auto auto auto auto); }
h5.NewsTitle {FONT-WEIGHT: bold; FONT-SIZE: 100%; MARGIN-BOTTOM: 1px; CLIP: rect(auto auto auto auto) }

.contentArea {TEXT-ALIGN: justify}

.topmenu {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #003366; FONT-FAMILY: verdana, arial, helvetica;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; TEXT-DECORATION: none; TEXT-ALIGN: center; TEXT-INDENT: 0mm;}
.topmenu:hover {TEXT-DECORATION: underline}

.cellheader {FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #003366; FONT-FAMILY: verdana, arial, helvetica; PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px;}
]]></style>
    </xsl:template>
    <xsl:template name="Counters">
        <a href="http://top100.rambler.ru/top100/">
            <img alt="Rambler's Top100" border="0" height="1" src="http://counter.rambler.ru/top100.cnt?259587" width="1"/>
        </a>
    </xsl:template>
    <xsl:template name="FirstPart">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td valign="top" width="100%">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr height="52" width="100%">
                            <td height="52" width="58">
                                <a href="{$site/@link}" title="??????? ?? ??????? ???????? ?????">
                                    <img alt="???? ?????? ???????-????? ?????????? ???????" border="0" height="52" src="ifs://$81899" width="58"/>
                                </a>
                            </td>
                            <td height="52" width="261">
                                <a href="{$site/@link}" title="??????? ?? ??????? ???????? ?????">
                                    <img alt="???????-?????. ?????????? ???????. ?????????????? ???? ?????? ???????-?????" border="0" height="52" src="ifs://$81900" width="261"/>
                                </a>
                            </td>
                            <td height="52" width="144">
                                <img height="52" src="ifs://$81901" width="144"/>
                            </td>
                            <td background="ifs://$81902" height="52" width="100%">
                                <font color="white" size="1px">
                                    <h1 style="DISPLAY:none">
                                        <xsl:value-of select="/*/keywords"/>
                                        <xsl:value-of select="/Forum/*/currentmessage/messageinfo/saved-body"/>
                                    </h1>
                                </font>
                            </td>
                        </tr>
                        <tr valign="top">
                            <td height="18" valign="top" width="58">
                                <a href="{$site/@link}" title="??????? ?? ??????? ???????? ?????">
                                    <img alt="???? ?????? ???????-?????" border="0" height="18" src="ifs://$81903" width="58"/>
                                </a>
                            </td>
                            <td colspan="3" width="100%">?<xsl:for-each select="$site">
                                    <xsl:call-template name="InsertNextNavigation_my"/>
                                </xsl:for-each>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="468">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td height="60" width="468">
                                <xsl:text disable-output-escaping="yes"><![CDATA[
<!-- RLE code START -->
<script language="JavaScript">
<!--
var RndNum4NoCash = Math.round(Math.random() * 1000000000);
document.write(
'<iframe src="http://ad.adriver.ru/cgi-bin/erle.cgi'
+ '?sid=55745&target=blank&bt=1&pz=0&rnd=' + RndNum4NoCash
+ '" frameborder=0 vspace=0 hspace=0 width=468 height=60 marginwidth=0 marginheight=0 scrolling=no>'
+ '<a href="http://ad.adriver.ru/cgi-bin/click.cgi'
+ '?sid=55745&bt=1&pz=0&rnd=' + RndNum4NoCash + '" target=_blank>'
+ '<img src="http://ad.adriver.ru/cgi-bin/rle.cgi?'
+ 'sid=55745&bt=1&pz=0&rnd=' + RndNum4NoCash
+ '" alt="-AdRiver-" border=0 width=468 height=60></a></iframe>')
// -->
</script>
<noscript>
<iframe src="http://ad.adriver.ru/cgi-bin/erle.cgi?sid=55745&target=blank&bt=1&pz=0&rnd=1458948812" frameborder=0 vspace=0 hspace=0 width=468 height=60 marginwidth=0 marginheight=0 scrolling=no>
<a href="http://ad.adriver.ru/cgi-bin/click.cgi?sid=55745&bt=1&pz=0&rnd=1458948812" target=_blank>
<img src="http://ad.adriver.ru/cgi-bin/rle.cgi?sid=55745&bt=1&pz=0&rnd=1458948812" alt="-AdRiver-" border=0 width=468 height=60></a></iframe>
</noscript>
<!-- RLE code END -->
]]></xsl:text>
                            </td>
                        </tr>
                        <tr valign="top">
                            <td align="right" height="18" width="468">
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <xsl:for-each select="/*/links[id='47287']/shortcut">
                                            <xsl:sort data-type="number" select="@order"/>
                                            <td align="center" class="topmenu" width="33%">
                                                <xsl:if test="@anchor='shortcut.47291'">
                                                    <a class="topmenu" href="{url}" title="{comment}">
                                                        <xsl:value-of select="name"/>
                                                    </a>
                                                </xsl:if>
                                                <xsl:if test="@anchor='shortcut.47290'">
                                                    <xsl:variable name="userCount" select="count(/*/arp:module[@name='general_xsl-chat-users']//user)"/>
                                                    <xsl:choose>
                                                        <xsl:when test="$userCount &gt; 0">
                                                            <b>
                                                                <a class="topmenu" href="{url}">
                                                                    <xsl:attribute name="title"><xsl:value-of select="comment"/> - <xsl:value-of select="$userCount"/> ? ????</xsl:attribute>
                                                                    <xsl:value-of select="name"/> (<xsl:value-of select="$userCount"/>)</a>
                                                            </b>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                            <a class="topmenu" href="{url}" title="{comment}">
                                                                <xsl:value-of select="name"/>
                                                            </a>
                                                        </xsl:otherwise>
                                                    </xsl:choose>
                                                </xsl:if>
                                                <xsl:if test="@anchor='shortcut.47288'">
                                                    <a class="topmenu" href="{url}" title="{comment}">
                                                        <xsl:value-of select="name"/>
                                                    </a>
                                                </xsl:if>
                                                <xsl:if test="@anchor='shortcut.102359'">
                                                    <a class="topmenu" href="{url}" title="{comment}">
                                                        <xsl:value-of select="name"/>
                                                    </a>
                                                </xsl:if>
                                            </td>
                                        </xsl:for-each>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template name="InsertNextNavigation_my">
        <a class="topmenu" href="{@link}" title="{@comment}">
            <xsl:value-of select="@name"/>
        </a>
        <xsl:if test="name(.)!='topic'">
            <xsl:for-each select="*[(@active='true') and (@cell != /*/@cellid)]"><![CDATA[ > ]]><xsl:call-template name="InsertNextNavigation_my"/>
            </xsl:for-each>
        </xsl:if>
    </xsl:template>
    <xsl:template name="SecondPart"/>
    <xsl:template name="drawContentTemplateBox">
        <xsl:param name="contentName">
            <xsl:value-of select="/*/name"/>
        </xsl:param>
        <xsl:param name="contentDescription">
            <xsl:value-of select="/*/description"/>
        </xsl:param>
        <xsl:if test="not (string-length($contentName)=0)">
            <h2 align="center">
                <xsl:value-of select="$contentName"/>
            </h2>
        </xsl:if>
        <xsl:if test="not (string-length($contentDescription)=0)">
            <h4 align="center">
                <xsl:value-of select="$contentDescription"/>
            </h4>
        </xsl:if>
        <xsl:apply-templates select="/*"/>
        <xsl:if test="/article | /galery">
            <xsl:call-template name="drawComments"/>
        </xsl:if>
    </xsl:template>
    <xsl:template name="drawComments">
        <br/>
        <a name="fresh-review">
            <table align="center">
                <tr>
                    <td align="left">
                        <xsl:for-each select="/*/context-discussion">
                            <xsl:choose>
                                <xsl:when test="$showComments=0">
                                    <center>
                                        <xsl:variable name="text">
                                            <xsl:value-of select="/*/link"/>?xsl:showComments=1;#fresh-review</xsl:variable>
                                        <a href="{$text}">???????? ??????????? ????????? (<xsl:value-of select="count(discussion/opinion)"/>) ??? ???????? ????</a>
                                    </center>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:for-each select="discussion">
                                        <h4>??????????? ?????????</h4>
                                        <xsl:for-each select="opinion">?????: <b>
                                                <xsl:value-of select="@author"/>
                                            </b> (<xsl:value-of select="date/date"/>)<br/>
                                            <b>
                                                <xsl:value-of select="@topic"/>
                                                <br/>
                                            </b>
                                            <xsl:copy-of select="message"/>
                                            <xsl:if test="not (position() = count(../opinion))">
                                                <hr/>
                                            </xsl:if>
                                        </xsl:for-each>
                                    </xsl:for-each>
                                    <xsl:for-each select="webform">
                                        <h4>???????? ???? ???????????</h4>
                                        <form action="{@action}" i18n:bundle="ru.arptek.infospace.discussion" method="post">
                                            <xsl:for-each select="field">
                                                <xsl:apply-templates select=".">
                                                    <xsl:with-param name="style">width: 300pt</xsl:with-param>
                                                </xsl:apply-templates>
                                            </xsl:for-each>
                                            <center>
                                                <input type="submit" value="???????? ???????????"/>
                                            </center>
                                        </form>
                                    </xsl:for-each>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:for-each>
                    </td>
                </tr>
            </table>
        </a>
    </xsl:template>
    <xsl:template name="ThirdPart">
        <xsl:param name="contentName">
            <xsl:value-of select="/*/name"/>
        </xsl:param>
        <xsl:param name="contentDescription">
            <xsl:value-of select="/*/description"/>
        </xsl:param>
        <table align="center" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td align="center" id="cell1" valign="top" width="180"/>
                <td align="center" id="cell2" valign="top" width="100%"/>
                <td align="center" id="cell3" valign="top"/>
            </tr>
        </table>
        <div id="div1" style="float: left; width:180;  BORDER-RIGHT: #eecccc 1px solid; BORDER-TOP: #eecccc 1px solid; BORDER-LEFT: #eecccc 1px solid; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: #eecccc 1px solid;">
            <xsl:call-template name="my_left"/>
        </div>
        <div id="div2" style="float: center; width:100%; BORDER-RIGHT: #eecccc 1px solid; BORDER-TOP: #eecccc 1px solid; BORDER-LEFT: #eecccc 1px solid; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: #eecccc 1px solid;">
            <center>
                <table width="{$centerwidth}">
                    <tr>
                        <td class="contentArea">
                            <xsl:call-template name="drawContentTemplateBox">
                                <xsl:with-param name="contentName" select="$contentName"/>
                                <xsl:with-param name="contentDescription" select="$contentDescription"/>
                            </xsl:call-template>
                        </td>
                    </tr>
                </table>
            </center>
        </div>
        <xsl:if test="/*/arp:module[@name='most_newest'] or /*/arp:module[@name='freshcomments'] or /*/arp:module[@name='most_intresting']">
            <div id="div3" style="float: right; width:180;  BORDER-RIGHT: #eecccc 1px solid; BORDER-TOP: #eecccc 1px solid; BORDER-LEFT: #eecccc 1px solid; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: #eecccc 1px solid;">
                <xsl:call-template name="my_newest"/>
            </div>
            <div id="div4" style="float: right; width:180;  BORDER-RIGHT: #eecccc 1px solid; BORDER-TOP: #eecccc 1px solid; BORDER-LEFT: #eecccc 1px solid; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: #eecccc 1px solid;">
                <xsl:for select="/*/arp:module[@name='freshcomments']/fresh-reviews[*]">
                    <table bgcolor="0" cellpadding="3" cellspacing="0" width="{$leftwidth}">
                        <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                            <td class="cellheader">?????? ???????????</td>
                        </tr>
                        <tr bgcolor="white" width="{$leftwidth}">
                            <td>
                                <xsl:for-each select="*">
                                    <li>
                                        <font size="-2">
                                            <a href="{@link}?xsl:showComments=1;#fresh-review">
                                                <xsl:value-of select="@name"/>
                                            </a>
                                        </font>
                                    </li>
                                </xsl:for-each>
                            </td>
                        </tr>
                    </table>
                </xsl:for>
            </div>
            <div id="div5" style="float: right; width:180;  BORDER-RIGHT: #eecccc 1px solid; BORDER-TOP: #eecccc 1px solid; BORDER-LEFT: #eecccc 1px solid; CLIP: rect(auto auto auto auto); BORDER-BOTTOM: #eecccc 1px solid;">
                <xsl:if test="/*/id=12889">
                    <!-- Rating -->
                    <table bgcolor="0" cellpadding="3" cellspacing="0" width="{$leftwidth}">
                        <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                            <td class="cellheader">????? ??????????</td>
                        </tr>
                        <tr bgcolor="white" width="{$leftwidth}">
                            <td>
                                <xsl:for-each select="/*/arp:module[@name='most_intresting']/rating/*">
                                    <li>
                                        <font size="-2">
                                            <a href="{link}" title="{comment}">
                                                <xsl:value-of select="name"/>
                                            </a>
                                        </font>
                                    </li>
                                </xsl:for-each>
                            </td>
                        </tr>
                    </table>
                </xsl:if>
            </div>
        </xsl:if>
        <script language="javascript"><![CDATA[<!--
cell1.appendChild(div1);
cell2.appendChild(div2);]]><xsl:if test="/*/arp:module[@name='most_newest'] or /*/arp:module[@name='freshcomments'] or /*/arp:module[@name='most_intresting']"><![CDATA[
if (screen.width >= ]]><xsl:value-of select="$leftwidth + $centerwidth + $rightwidth"/><![CDATA[) {
        cell3.appendChild(div3);
        cell3.appendChild(div4);
        cell3.appendChild(div5);
}]]></xsl:if><![CDATA[
-->]]></script>
        <div align="center" style="float: left; width: 100%; border: none;">
            <xsl:call-template name="Footer"/>
        </div>
    </xsl:template>
    <xsl:template name="Footer">
        <table bgcolor="#EECCCC" border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td align="center" valign="middle" width="100">?</td>
                <td align="left" valign="middle">
                    <p style="FONT-WEIGHT: bold; FONT-SIZE: 7pt; COLOR: #001144;">
                        <br/>?????????????? ???? ?????? ???????-?????.<br/>
                        <xsl:text disable-output-escaping="yes"><![CDATA[&copy;]]></xsl:text>1999-2003 ?????????? ??????; <a href="mailto:zuevo_ru@mail.ru">??????? ??????</a>; ????? ???????;<br/>??? ???????? ??????? ???????????? <a href="http://www.arptek.ru">???-??????????</a>.<br/>
                        <br/>
                    </p>
                </td>
                <td align="center" valign="middle">
                    <a href="http://top100.rambler.ru/top100/">
                        <img alt="Rambler's Top100" border="0" height="31" src="http://top100-images.rambler.ru/top100/w2.gif" width="88"/>
                    </a>?<a href="http://www.mosobl.ru/">
                        <img alt="?????????????-??????? ?????? ?????????? ???????" border="0" height="31" src="http://www.mosobl.ru/images/banners/mosobl-88x31.gif" width="88"/>
                    </a>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template name="my_random_person">
        <xsl:for-each select="/*/arp:module[@name='random_person']/random/article">
            <table bgcolor="0" cellpadding="3" cellspacing="0" width="{$leftwidth}">
                <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                    <td class="cellheader">? ?? ?????? ????? ?????????</td>
                </tr>
                <tr bgcolor="white" width="{$leftwidth}">
                    <td>
                        <center>
                            <a href="ifs://{@cell}">
                                <img alt="{@name}" border="0" src="ifs://xpath:{@cell}://*[@current='true']/file[@name='foto']?w=75"/>
                                <br/>
                                <b>
                                    <xsl:value-of select="@name"/>
                                </b>
                            </a>
                        </center>
                    </td>
                </tr>
            </table>
        </xsl:for-each>
    </xsl:template>
    <xsl:template name="my_left">
        <xsl:for-each select="/*/search">
            <table cellpadding="3" cellspacing="0" width="{$leftwidth}">
                <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                    <td class="cellheader">????? ?? ?????</td>
                </tr>
                <form action="{@action}" method="post">
                    <tr bgcolor="white" width="{$leftwidth}">
                        <td>
                            <center>
                                <input class="noneborder" maxlength="30" name="{@fieldname}" size="10" style="width: 150" type="text"/>
                                <input border="0" class="noneborder" type="submit" value="&gt;"/>
                            </center>
                        </td>
                    </tr>
                </form>
            </table>
        </xsl:for-each>
        <table bgcolor="0" cellpadding="0" cellspacing="0" width="{$leftwidth}">
            <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                <td class="cellheader">?????????</td>
            </tr>
            <tr bgcolor="white" width="{$leftwidth}">
                <td>
                    <center>
                        <table border="0" cellPadding="0" cellSpacing="0" class="MenuTable" width="100%">
                            <xsl:for-each select="/*/links">
                                <xsl:if test="id='36820' or id='36825' or id='36829' or id='36841' or id='36842' or id='36851'">
                                    <xsl:if test="not (name='-')">
                                        <tr>
                                            <td class="MenuTitle">
                                                <xsl:value-of select="name"/>
                                            </td>
                                        </tr>
                                    </xsl:if>
                                    <xsl:for-each select="shortcut">
                                        <TR>
                                            <TD class="MenuItem">
                                                <a class="menu" href="{url}" title="{comment}">
                                                    <xsl:value-of select="name"/>
                                                </a>
                                            </TD>
                                        </TR>
                                    </xsl:for-each>
                                </xsl:if>
                            </xsl:for-each>
                        </table>
                    </center>
                </td>
            </tr>
        </table>
        <xsl:call-template name="my_random_person"/>
    </xsl:template>
    <xsl:template name="my_newest">
        <xsl:if test="/*/arp:module[@name='most_newest']/rating/*">
            <table bgcolor="0" cellpadding="3" cellspacing="0" width="{$leftwidth}">
                <tr align="center" bgcolor="#eecccc" width="{$leftwidth}">
                    <td class="cellheader">?????? ?????????</td>
                </tr>
                <tr bgcolor="white" width="{$leftwidth}">
                    <td>
                        <xsl:for-each select="/*/arp:module[@name='most_newest']/rating/*">
                            <li>
                                <font size="-2">
                                    <a href="{link}" title="{comment}">
                                        <xsl:value-of select="name"/>
                                    </a>
                                </font>
                            </li>
                        </xsl:for-each>
                    </td>
                </tr>
            </table>
        </xsl:if>
    </xsl:template>
    <xsl:template name="shortcut">
        <a href="{url}" title="{comment}">
            <xsl:value-of select="name"/>
        </a>
    </xsl:template>
    <xsl:template name="space">
        <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
    </xsl:template>
	<xsl:param name="onlynew">false</xsl:param>
	<xsl:template name="NewsLineTemplate">
		<xsl:param name="forceHTML">0</xsl:param>
		<xsl:param name="defaultURLname">0</xsl:param>
		<xsl:param name="drawNewslineTitle">1</xsl:param>
		<xsl:param name="drawCommentLink">0</xsl:param>
		<xsl:param name="drawCommentLinkPostfix" select="'#fresh-review'"/>
		<xsl:param name="URLPrefix"/>
		<xsl:if test="count(../NewsLine) &gt; 1 and $drawNewslineTitle=1">
			<h3>
				<xsl:value-of select="name"/>
			</h3>
		</xsl:if>
		<xsl:variable name="isCustom" select="name(/.)='custom'"/>
		<xsl:variable name="onlynew" select="$isCustom or $onlynew"/>
		<xsl:variable name="showNewsCount">
			<xsl:if test="$onlynew">
				<xsl:value-of select="newscount"/>
			</xsl:if>
			<xsl:if test="not ($onlynew)">
				<xsl:value-of select="news_per_page"/>
			</xsl:if>
		</xsl:variable>
		<xsl:for-each select="news[@state='published']">
			<xsl:sort select="@order" order="descending" data-type="number"/>
			<xsl:if test="position() &lt;= $showNewsCount">
				<xsl:if test="$defaultURLname != '0'">
					<xsl:call-template name="NewsTemplate">
						<xsl:with-param name="URLPrefix" select="$URLPrefix"/>
						<xsl:with-param name="defaultURLname" select="$defaultURLname"/>
						<xsl:with-param name="forceHTML" select="$forceHTML"/>
						<xsl:with-param name="drawCommentLink" select="$drawCommentLink"/>
						<xsl:with-param name="drawCommentLinkPostfix" select="$drawCommentLinkPostfix"/>
					</xsl:call-template>
				</xsl:if>
				<xsl:if test="$defaultURLname = '0'">
					<xsl:call-template name="NewsTemplate">
						<xsl:with-param name="URLPrefix" select="$URLPrefix"/>
						<xsl:with-param name="forceHTML" select="$forceHTML"/>
						<xsl:with-param name="drawCommentLink" select="$drawCommentLink"/>
						<xsl:with-param name="drawCommentLinkPostfix" select="$drawCommentLinkPostfix"/>
					</xsl:call-template>
				</xsl:if>
			</xsl:if>
		</xsl:for-each>
		<xsl:for-each select="/*/pages[count(*) > 1]">
			<div style="font-size:90%; " align="center">Страницы: <xsl:for-each select="page">
					<xsl:if test="@active='true'">
						<b>
							<xsl:value-of select="@number"/>
						</b>
					</xsl:if>
					<xsl:if test="not(@active='true')">
						<a href="{url}">
							<xsl:value-of select="@number"/>
						</a>
					</xsl:if>
					<xsl:call-template name="nbsp"/>
				</xsl:for-each>
			</div>
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="NewsTemplate">
		<xsl:param name="view">0</xsl:param>
		<xsl:param name="onlynew">1</xsl:param>
		<xsl:param name="eng">0</xsl:param>
		<xsl:param name="forceHTML">0</xsl:param>
		<xsl:param name="defaultURLname" select="url"/>
		<xsl:param name="URLPrefix"/>
		<xsl:param name="drawCommentLink">0</xsl:param>
		<xsl:param name="drawCommentLinkPostfix" select="'#fresh-review'"/>
		<!-- xsl:if test="file[starts-with(mime,'image/')]">
			<xsl:if test="not(../titlelink='true') or (string-length(link)=0 and string-length(url)=0)">
				<img src="{file/link}?l=300" alt="{file/name}" align="right"/>
			</xsl:if>
			<xsl:if test="(../titlelink='true') and (string-length(content)!=0 and string-length(url/text())=0)">
				<a href="{link}">
					<img src="{file/link}?l=300" alt="{file/name}" align="right"/>
				</a>
			</xsl:if>
			<xsl:if test="(../titlelink='true') and (string-length(content)=0 and string-length(url/text())!=0)">
				<a href="{url}">
					<img src="{file/link}?l=300" alt="{file/name}" align="right"/>
				</a>
			</xsl:if>
		</xsl:if -->
		<xsl:if test="$view=0">
			<h5 class="NewsTitle">
				<xsl:if test="not(../titlelink='true') or (string-length(link)=0 and string-length(url)=0)">
					<xsl:value-of select="name"/>
				</xsl:if>
				<xsl:if test="(../titlelink='true') and (string-length(content)!=0 and string-length(url/text())=0)">
					<a href="{link}">
						<xsl:value-of select="name"/>
					</a>
				</xsl:if>
				<xsl:if test="(../titlelink='true') and (string-length(content)=0 and string-length(url/text())!=0)">
					<a href="{url}">
						<xsl:value-of select="name"/>
					</a>
				</xsl:if>
			</h5>
		</xsl:if>
		<xsl:if test="$view=0">
			<p>
				<xsl:if test="../showdate='true'">
					<strong>
						<xsl:value-of select="event_date/date"/>: </strong>
					<xsl:call-template name="nbsp"/>
				</xsl:if>
				<xsl:if test="../showcontent='true'">
					<xsl:for-each select="longtitle">
						<xsl:call-template name="NewsLineTextTemplate">
							<xsl:with-param name="useGlobalP" select="1"/>
							<xsl:with-param name="forceHTML" select="$forceHTML"/>
						</xsl:call-template>
					</xsl:for-each>
				</xsl:if>
				<xsl:if test="../showfullcontent='true'">
					<xsl:for-each select="content">
						<xsl:call-template name="NewsLineTextTemplate">
							<xsl:with-param name="useGlobalP" select="1"/>
							<xsl:with-param name="forceHTML" select="$forceHTML"/>
						</xsl:call-template>
					</xsl:for-each>
				</xsl:if>
				<xsl:if test="not(string-length(content)=0) and not(../titlelink='true') and not(../showfullcontent='true')">
					<xsl:if test="$onlynew=1">
						<xsl:call-template name="space"/>
						<xsl:choose>
							<xsl:when test="$eng='1'">
								<a href="{link}?&amp;xsl:onlynew=1">More details...</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="{link}?&amp;xsl:onlynew=1">Подробнее...</a>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
					<xsl:if test="$onlynew=0">
						<xsl:call-template name="space"/>
						<xsl:choose>
							<xsl:when test="$eng=1">
								<a href="{link}?&amp;xsl:onlynew=0">More details...</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="{link}?&amp;xsl:onlynew=0">Подробнее...</a>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
				</xsl:if>
				<xsl:call-template name="nbsp"/>
				<xsl:if test="(string-length(content)=0 or (../showfullcontent='true')) and string-length(url)!=0 and not(../titlelink='true')">
					<a href="{$URLPrefix}{url}">
						<xsl:if test="string-length(urlname)!=0">
							<xsl:value-of select="urlname"/>
						</xsl:if>
						<xsl:if test="string-length(urlname)=0">
							<xsl:value-of select="$defaultURLname"/>
						</xsl:if>
					</a>
				</xsl:if>
			</p>
			<xsl:if test="$drawCommentLink=1">
				<p align="right">
					<a href="{link}{$drawCommentLinkPostfix}">Комментарии</a>
				</p>
			</xsl:if>
		</xsl:if>
		<xsl:if test="$view=1">
			<xsl:if test="(content/text()!='') or (count(content/*)!=0)">
				<xsl:for-each select="content">
					<xsl:call-template name="NewsLineTextTemplate">
						<xsl:with-param name="forceHTML" select="$forceHTML"/>
					</xsl:call-template>
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="(not(content/text()!='') and not(count(content/*)!=0))">
				<xsl:for-each select="longtitle">
					<xsl:call-template name="NewsLineTextTemplate">
						<xsl:with-param name="forceHTML" select="$forceHTML"/>
					</xsl:call-template>
				</xsl:for-each>
			</xsl:if>
			<p>
				<a href="{$URLPrefix}{url}">
					<xsl:if test="string-length(urlname)!=0">
						<xsl:value-of select="urlname"/>
					</xsl:if>
					<xsl:if test="((string-length(urlname)=0) and (string-length(urlname)!=0))">
						<xsl:value-of select="url"/>
					</xsl:if>
				</a>
			</p>
		</xsl:if>
	</xsl:template>
	<xsl:template name="NewsLineTextTemplate">
		<xsl:param name="useGlobalP">0</xsl:param>
		<xsl:param name="forceHTML">0</xsl:param>
		<xsl:choose>
			<xsl:when test="html">asd</xsl:when>
			<xsl:when test="count(p)=0">
				<xsl:choose>
					<xsl:when test="$useGlobalP=0">
						<p>
							<xsl:for-each select="text() | *">
								<xsl:copy-of select="."/>
							</xsl:for-each>
						</p>
					</xsl:when>
					<xsl:otherwise>
						<xsl:for-each select="text() | *">
							<xsl:copy-of select="."/>
						</xsl:for-each>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="$useGlobalP=0">
						<xsl:apply-templates select="." mode="html"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:for-each select="*|text()">
							<xsl:choose>
								<xsl:when test="name()='p'">
									<xsl:if test="position() != 1">
										<xsl:text disable-output-escaping="yes"><![CDATA[<p>]]></xsl:text>
									</xsl:if>
									<xsl:choose>
										<xsl:when test="$forceHTML=0">
											<xsl:copy-of select="*|text()"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of disable-output-escaping="yes" select="text()"/>
										</xsl:otherwise>
									</xsl:choose>
									<xsl:if test="position() != count(../p)">
										<xsl:text disable-output-escaping="yes"><![CDATA[</p>]]></xsl:text>
									</xsl:if>
								</xsl:when>
								<xsl:otherwise>
									<xsl:copy-of select="."/>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:for-each>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
    <arp:module format="new" name="most_intresting" select="//site[@active='true']/.." tail="10 1 0 10 3,5,15,51" type="rating"/>
    <arp:module format="new" name="most_newest" select="//site[@active='true']/.." tail="10 0 1 30 3,5,15,51" type="rating"/>
    <arp:module format="new" name="freshcomments" select="//*[@cell='150086']" type="fresh"/>
    <arp:module name="add-subscriber" select="//site[@active='true']/subscription" type="add-subscriber"/>
    <xsl:template match="/custom">
        <xsl:for-each select="/*/arp:module[@name='add-subscriber']/add-subscriber">
            <center>
                <table width="100%">
                    <tr>
                        <td align="center">
                            <h4>???????? ?? ??????? ????? ?????? ???????-?????.</h4>
                            <form action="{@action}" method="post">
                                <input name="{@param-name}" size="25" type="text"/>
                                <xsl:call-template name="nbsp"/>
                                <input type="submit" value="???????????"/>
                            </form>
                        </td>
                        <td>
                            <a href="http://www.gismeteo.ru/weather/towns/99972.htm" title="?????? ? ?????? ???????-?????">
                                <img align="right" alt="?????? ? ?????? ???????-?????" border="0" height="60" hspace="10" src="http://informer.gismeteo.ru/99972-10.GIF" vspace="5" width="120"/>
                            </a>
                        </td>
                    </tr>
                </table>
            </center>
        </xsl:for-each>
        <xsl:for-each select="NewsLine[id=12890]">
            <xsl:call-template name="NewsLineTemplate">
                <xsl:with-param name="drawNewslineTitle" select="0"/>
            </xsl:call-template>
        </xsl:for-each>
        <table border="0" cellpadding="0" cellspacing="5" width="548">
            <tr>
                <td valign="top" width="274">
                    <xsl:for-each select="/custom/NewsLine[id='41987']">
                        <xsl:call-template name="NewsLineTemplate">
                            <xsl:with-param name="defaultURLname">?????????</xsl:with-param>
                            <xsl:with-param name="URLPrefix">http://www.mosoblpress.ru/oreh/</xsl:with-param>
                            <xsl:with-param name="forceHTML" select="1"/>
                        </xsl:call-template>
                    </xsl:for-each>
                </td>
                <td valign="top" width="274">
                    <xsl:for-each select="/custom/NewsLine[id=44072]">
                        <xsl:call-template name="NewsLineTemplate">
                            <xsl:with-param name="defaultURLname">?????????</xsl:with-param>
                            <xsl:with-param name="URLPrefix">http://www.mosoblpress.ru/svoyagazeta/</xsl:with-param>
                            <xsl:with-param name="forceHTML" select="1"/>
                        </xsl:call-template>
                    </xsl:for-each>
                </td>
            </tr>
        </table>
    </xsl:template>
    <!--xsl:param name="max" select="count(/Forum/Forumslist/forum[not(@denied='true')]) div 2"/-->
    <xsl:param name="max" select="count(/board/categories/category/topic[not(@denied='true')])"/>
    <xsl:template match="/board/categories" name="drawBoardTopicList">
        <!--?????? ????????? ??????-->
        <xsl:for-each select="/board/categories/category/topic[not(@denied='true')]">
            <xsl:sort data-type="number" order="ascending" select="@order"/>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <xsl:if test="position() mod 2 = 1">
                    <tr>
                        <td class="text" style="padding-left:5px;" valign="top" width="50%">
                            <xsl:call-template name="drawBoardTopicInfo"/>
                            <br/>
                            <br/>
                        </td>
                        <td width="10">??</td>
                        <td class="text" valign="top" width="50%">
                            <xsl:variable name="pos" select="position()+1"/>
                            <xsl:if test="not($pos &gt; $max)">
                                <xsl:for-each select="/board/categories/category/topic[position()=$pos][not(@denied='true')]">
                                    <xsl:call-template name="drawBoardTopicInfo"/>
                                </xsl:for-each>
                            </xsl:if>
                            <br/>
                            <br/>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:for-each>
    </xsl:template>
    <xsl:template name="drawBoardTopicInfo">
        <div>
            <a class="forumlink" href="{link}">
                <b>
                    <xsl:value-of select="name"/>
                </b>
            </a>
            <br/>
        </div>
        <xsl:value-of select="comment"/>
        <div>
            <b>????? ?????????:</b>
            <xsl:text>?</xsl:text>
            <xsl:if test="numofnewmessages='0'">
                <xsl:value-of select="numofnewmessages"/>
            </xsl:if>
            <xsl:if test="not(numofnewmessages='0')">
                <a class="forumlink" href="{onlynewlink}">
                    <b>
                        <xsl:value-of select="numofnewmessages"/>
                    </b>
                </a>
            </xsl:if> ?? <xsl:value-of select="all-messages"/>
        </div>
        <xsl:for-each select="last-message">
            <b>????????? ?????????: </b>
            <a class="forumlink" href="{link}">
                <xsl:value-of select="name"/>
            </a>(<xsl:if test="isadmin='true'">
                <img alt="?????????????" src="ifs://20805"/>
            </xsl:if>
            <xsl:for-each select="author">
                <xsl:value-of select="."/>
            </xsl:for-each>, <xsl:value-of select="created/date"/>
                )</xsl:for-each>
    </xsl:template>
    <xsl:template match="pages[page]">
        <xsl:text>Goto page</xsl:text>
        <xsl:text><![CDATA[  ]]></xsl:text>
        <xsl:for-each select="page">
            <xsl:choose>
                <xsl:when test="@current = 'true'">
                    <xsl:value-of select="@index"/>
                </xsl:when>
                <xsl:otherwise>
                    <a href="{@link}">
                        <xsl:value-of select="@index"/>
                    </a>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:if test="position() != last()">
                <xsl:text>, </xsl:text>
                <xsl:if test="not ((@index + 1) = (following-sibling::page/@index))">
                    <xsl:text>... </xsl:text>
                </xsl:if>
            </xsl:if>
        </xsl:for-each>
        <xsl:for-each select="page[@index=current()/page[@current='true']/@index + 1]">
            <xsl:text><![CDATA[  ]]></xsl:text>
            <a href="{@link}">
                <xsl:text>Next</xsl:text>
            </a>
        </xsl:for-each>
    </xsl:template>
    <xsl:template match="@*|node()" mode="html">
        <xsl:copy>
            <xsl:apply-templates mode="html" select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <!-- Old-style tags -->
    <xsl:template match="image" mode="html">
        <img>
            <xsl:apply-templates mode="html" select="@*"/>
        </img>
    </xsl:template>
    <xsl:template match="list[@mode='points' or string-length(@mode)=0]" mode="html">
        <ul>
            <xsl:apply-templates mode="html" select="@*"/>
            <xsl:for-each select="item">
                <li>
                    <xsl:apply-templates mode="html" select="@*|node()"/>
                </li>
            </xsl:for-each>
        </ul>
    </xsl:template>
    <xsl:template match="list[@mode='nums']" mode="html">
        <ol>
            <xsl:apply-templates mode="html" select="@*"/>
            <xsl:for-each select="item">
                <li>
                    <xsl:apply-templates mode="html" select="@*|node()"/>
                </li>
            </xsl:for-each>
        </ol>
    </xsl:template>
    <xsl:template match="/topic[@board-type='tree']/messages/page-messages">
        <xsl:for-each select="message">
            <ul type="square">
                <xsl:call-template name="ru.arptek.talk.board.tree.drawMessageTree">
                    <xsl:with-param name="collapce" select="count(.//message) &gt; 15"/>
                    <xsl:with-param name="output-body" select="0"/>
                </xsl:call-template>
            </ul>
            <br/>
        </xsl:for-each>
    </xsl:template>
    <xsl:template match="/message[@board-type='tree']/message-tree/message">
        <ul type="square">
            <xsl:call-template name="ru.arptek.talk.board.tree.drawMessageTree">
                <xsl:with-param name="output-body" select="1"/>
            </xsl:call-template>
        </ul>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.tree.drawMessageTree">
        <xsl:param name="collapce" select="0 = 1"/>
        <xsl:param name="output-body" select="0"/>
        <li>
            <xsl:if test="$collapce">
                <xsl:call-template name="ru.arptek.talk.board.tree.drawCollapsedIcon">
                    <xsl:with-param name="all" select="count(.//message)"/>
                    <xsl:with-param name="new" select="count(.//message[@new-message='true'])"/>
                </xsl:call-template>
            </xsl:if>
            <xsl:if test="@new-message='true'">
                <xsl:call-template name="ru.arptek.talk.board.tree.drawIsNewIcon"/>
            </xsl:if>
            <xsl:choose>
                <xsl:when test="id = /message/id">
                    <xsl:if test="body and $output-body=1">
                        <xsl:attribute name="title"><xsl:value-of disable-output-escaping="no" select="body"/></xsl:attribute>
                    </xsl:if>
                    <xsl:value-of select="name"/>
                    <xsl:if test="isempty='true'">
                        <b> (-) </b>
                    </xsl:if>
                </xsl:when>
                <xsl:otherwise>
                    <a href="{link}">
                        <xsl:if test="body and $output-body=1">
                            <xsl:attribute name="title"><xsl:value-of disable-output-escaping="no" select="body"/></xsl:attribute>
                        </xsl:if>
                        <xsl:value-of select="name"/>
                        <xsl:if test="isempty='true'">
                            <b> (-) </b>
                        </xsl:if>
                    </a>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:if test="string-length(url)!=0">
                <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
                <a href="{url}" title="{url}">[URL]</a>
                <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
            </xsl:if>
            <xsl:if test="string-length(imageurl)!=0">
                <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
                <a href="{imageurl}" title="{imageurl}">[Image]</a>
                <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
            </xsl:if> (<xsl:if test="isadmin='true'">
                <xsl:call-template name="ru.arptek.talk.board.tree.drawAdminIcon"/>
            </xsl:if>
            <xsl:call-template name="ru.arptek.talk.board.tree.drawAuthorText">
                <xsl:with-param name="profile" select="author-profile"/>
            </xsl:call-template>, <xsl:value-of select="created/date"/>
            <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
            <xsl:value-of select="created/time"/>) <xsl:if test="not ($collapce) and not(count(message)=0)">
                <ul type="square">
                    <xsl:for-each select="message">
                        <xsl:call-template name="ru.arptek.talk.board.tree.drawMessageTree"/>
                    </xsl:for-each>
                </ul>
            </xsl:if>
        </li>
    </xsl:template>
    <xsl:template name="ru.arptek.board.tree.drawSingleMessage">
        <table border="0" cellpadding="1" cellspacing="0" width="100%">
            <tr>
                <td class="forumborder">
                    <table border="0" cellpadding="2" cellspacing="1" width="100%">
                        <tr bgcolor="#FCFCFC">
                            <td class="text" width="150">
                                <b>Subject:</b>
                            </td>
                            <td class="text">
                                <xsl:value-of select="name"/>
                            </td>
                        </tr>
                        <tr bgcolor="#FCFCFC">
                            <td class="text">
                                <b>Author:</b>
                            </td>
                            <td class="text">
                                <xsl:call-template name="ru.arptek.talk.board.tree.drawAuthorText">
                                    <xsl:with-param name="profile" select="author-profile"/>
                                </xsl:call-template>
                            </td>
                        </tr>
                        <tr bgcolor="#FCFCFC">
                            <td class="text">
                                <b>Date:</b>
                            </td>
                            <td class="text">
                                <xsl:value-of select="created/GMT"/>
                            </td>
                        </tr>
                        <tr bgcolor="#FCFCFC">
                            <td class="text" valign="top">
                                <b>Body:</b>
                            </td>
                            <td class="text">
                                <xsl:value-of disable-output-escaping="yes" select="html"/>
                                <xsl:if test="string-length(html)=0">no content</xsl:if>
                            </td>
                        </tr>
                        <xsl:if test="string-length(urlimage)!=0">
                            <tr bgcolor="#FCFCFC">
                                <td colspan="2">
                                    <img alt="{urlimage}" src="{urlimage}"/>
                                </td>
                            </tr>
                        </xsl:if>
                        <xsl:if test="string-length(urllink)!=0">
                            <tr bgcolor="#FCFCFC">
                                <td class="text">
                                    <b>URL:</b>
                                </td>
                                <td class="text">
                                    <a href="{urllink}">
                                        <xsl:if test="string-length(urlname)!=0">
                                            <xsl:value-of select="urlname"/>
                                        </xsl:if>
                                        <xsl:if test="string-length(urlname)=0">
                                            <xsl:value-of select="urllink"/>
                                        </xsl:if>
                                    </a>
                                </td>
                            </tr>
                        </xsl:if>
                    </table>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.tree.drawAdminIcon">
        <a style="FONT-WEIGHT: bold; COLOR: yellow" title="Moderator">*</a>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.tree.drawAuthorText">
        <xsl:param name="profile"/>
        <xsl:choose>
            <xsl:when test="$profile/@registered='true'">
                <a href="{$profile/@link}">
                    <xsl:value-of select="$profile/userName"/>
                </a>
            </xsl:when>
            <xsl:when test="not ($profile/@registered='true') and string-length($profile/EMail)!=0">
                <a href="mailto:{$profile/EMail}">
                    <xsl:value-of select="$profile/userName"/>
                </a>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$profile/userName"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.tree.drawCollapsedIcon">
        <xsl:param name="all"/>
        <xsl:param name="new"/>
        <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
        <a style="color: darkblue; TEXT-DECORATION: none">
            <xsl:attribute name="title">New: <xsl:value-of select="$new"/> All: <xsl:value-of select="$all"/></xsl:attribute>[collapsed]</a>
        <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.tree.drawIsNewIcon">
        <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
        <span style="color: green; TEXT-DECORATION: none">[new]</span>
        <xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
    </xsl:template>
    <xsl:template name="ru.arptek.talk.board.drawMenuTemplate">
        <table align="center">
            <tr>
                <td align="center" class="text" colspan="4" i18n:bundle="ru.arptek.talk.board.menu">
                    <xsl:for-each select="/*/board_menu/*">
                        <a href="{.}">
                            <xsl:if test="name()='new-topic'">
                                <xsl:attribute name="style">color:#AD0320;font-weight:bold;</xsl:attribute>
                            </xsl:if>
                            <i18n:value>
                                <xsl:value-of select="name()"/>
                            </i18n:value>
                        </a>
                        <xsl:if test="position() != last()">
                            <b>
                                <xsl:text> | </xsl:text>
                            </b>
                        </xsl:if>
                    </xsl:for-each>
                </td>
            </tr>
        </table>
    </xsl:template>
    <xsl:template match="/message/webform | /topic/webform">
        <form action="{@action}" i18n:bundle="ru.arptek.board.form" method="post">
            <xsl:for-each select="*">
                <xsl:choose>
                    <xsl:when test="name() = 'field' and (@type='text' or @type='area')">
                        <xsl:apply-templates select=".">
                            <xsl:with-param name="style">width:400px;</xsl:with-param>
                            <xsl:with-param name="showComments">0</xsl:with-param>
                        </xsl:apply-templates>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:apply-templates select="."/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
            <center>
                <input i18n:attr="value" type="submit" value="Create message"/>
            </center>
        </form>
    </xsl:template>
    <xsl:template match="webform">
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="style"/>
        <form action="{@action}" method="post">
            <xsl:apply-templates>
                <xsl:with-param name="showComments" select="$showComments"/>
                <xsl:with-param name="style" select="$style"/>
            </xsl:apply-templates>
            <xsl:if test="count(.//field[@type='button'])=0">
                <input type="submit"/>
            </xsl:if>
        </form>
    </xsl:template>
    <xsl:template match="webform//group">
        <fieldset>
            <legend>
                <b>
                    <i18n:value>
                        <xsl:value-of select="@title"/>
                    </i18n:value>
                </b>
                <br/>
                <i18n:value>
                    <xsl:value-of select="@comment"/>
                </i18n:value>
            </legend>
            <xsl:apply-templates select="*"/>
        </fieldset>
    </xsl:template>
    <xsl:template match="webform//field[@type='text' and not (@password='true')]" name="drawTextFieldTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="class">textField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="comment" select="@comment"/>
        <xsl:param name="style"/>
        <xsl:param name="text">
            <xsl:value-of select="."/>
        </xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <b>
                <i18n:value>
                    <xsl:value-of select="$title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <i18n:value>
                    <xsl:value-of select="@error"/>
                </i18n:value>
            </xsl:if>
            <br/>
            <xsl:if test="$showComments=1 and string-length($comment) &gt; 0">
                <i18n:value>
                    <xsl:value-of select="$comment"/>
                </i18n:value>
                <br/>
            </xsl:if>
            <input i18n:attr="title" name="{@id}" title="{$comment}" type="text" value="{$text}">
                <xsl:if test="$class">
                    <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
                </xsl:if>
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
            </input>
            <br/>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='text' and @password='true']" name="drawPasswordFieldTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="comment" select="@comment"/>
        <xsl:param name="class">passwordField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="style"/>
        <xsl:param name="text">
            <xsl:value-of select="."/>
        </xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <b>
                <i18n:value>
                    <xsl:value-of select="$title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <i18n:value>
                    <xsl:value-of select="@error"/>
                </i18n:value>
            </xsl:if>
            <br/>
            <xsl:if test="$showComments=1 and string-length($comment) &gt; 0">
                <i18n:value>
                    <xsl:value-of select="$comment"/>
                </i18n:value>
                <br/>
            </xsl:if>
            <input i18n:attr="title" name="{@id}" title="{@comment}" type="password" value="{$text}">
                <xsl:if test="$class">
                    <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
                </xsl:if>
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
            </input>
            <br/>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='area']" name="drawAreaFieldTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="comment" select="@comment"/>
        <xsl:param name="class">areaField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="showExpandLink">0</xsl:param>
        <xsl:param name="style"/>
        <xsl:param name="text">
            <xsl:value-of select="."/>
        </xsl:param>
        <xsl:param name="rows">5</xsl:param>
        <xsl:param name="cols">45</xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <b>
                <i18n:value>
                    <xsl:value-of select="$title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <i18n:value>
                    <xsl:value-of select="@error"/>
                </i18n:value>
            </xsl:if>
            <br/>
            <xsl:if test="$showComments=1 and string-length(@comment) &gt; 0">
                <i18n:value>
                    <xsl:value-of select="@comment"/>
                </i18n:value>
                <br/>
            </xsl:if>
            <textarea cols="{$cols}" i18n:attr="title" id="area{@id}" name="{@id}" rows="{$rows}" style="{$style}" title="{$comment}">
                <xsl:if test="$class">
                    <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
                </xsl:if>
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
                <xsl:value-of select="$text"/>
            </textarea>
            <br/>
            <xsl:if test="$showExpandLink=1">
                <div align="right">
                    <a onClick="area{@id}.style.width='700px'; area{@id}.style.height='400px';">expand</a>
                </div>
            </xsl:if>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='checkbox']" name="drawCheckboxFieldTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="comment" select="@comment"/>
        <xsl:param name="class">.field.textField</xsl:param>
        <xsl:param name="errorclass">.field.textField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="style"/>
        <xsl:param name="selected">
            <xsl:value-of select="@selected"/>
        </xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <input name="{@id}" title="{$comment}" type="checkbox">
                <xsl:attribute name="class"><xsl:choose><xsl:when test="@error"><xsl:value-of select="$errorclass"/></xsl:when><xsl:otherwise><xsl:value-of select="$class"/></xsl:otherwise></xsl:choose></xsl:attribute>
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
                <xsl:if test="$selected='true'">
                    <xsl:attribute name="checked">checked</xsl:attribute>
                </xsl:if>
            </input>
            <b>
                <i18n:value>
                    <xsl:value-of select="$title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <i18n:value>
                    <xsl:value-of select="@error"/>
                </i18n:value>
            </xsl:if>
            <xsl:if test="$showComments=1 and string-length(@comment) &gt; 0">
                <br/>
                <i18n:value>
                    <xsl:value-of select="$comment"/>
                </i18n:value>
            </xsl:if>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='select']" name="drawSelectFieldTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="comment" select="@comment"/>
        <xsl:param name="class">selectField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="selectFormFieldValuesAsI18nKeys">0</xsl:param>
        <xsl:param name="style">width:300 px;</xsl:param>
        <xsl:param name="text">
            <xsl:value-of select="."/>
        </xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <b>
                <i18n:value>
                    <xsl:value-of select="@title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <i18n:value>
                    <xsl:value-of select="@error"/>
                </i18n:value>
            </xsl:if>
            <br/>
            <xsl:if test="$showComments=1 and string-length(@comment) &gt; 0">
                <i18n:value>
                    <xsl:value-of select="@comment"/>
                </i18n:value>
                <br/>
            </xsl:if>
            <select class="{$class}" name="{@id}" style="{style}">
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
                <xsl:variable name="formName" select="@name"/>
                <xsl:for-each select="choices/choice">
                    <option name="{../../@id}" value="{@value}">
                        <xsl:if test="../../@selected=@value">
                            <xsl:attribute name="selected">selected</xsl:attribute>
                        </xsl:if>
                        <xsl:choose>
                            <xsl:when test="$selectFormFieldValuesAsI18nKeys=1">
                                <i18n:value>
                                    <xsl:value-of select="$formName"/>.value.<xsl:value-of select="."/>
                                </i18n:value>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="."/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </option>
                </xsl:for-each>
            </select>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='hidden']" name="drawHiddenFieldTemplate">
        <xsl:param name="text">
            <xsl:value-of select="@value"/>
        </xsl:param>
        <input name="{@id}" type="hidden" value="{$text}"/>
    </xsl:template>
    <xsl:template match="webform//field[@type='upload']" name="drawFileFieldTemplate">
        <xsl:param name="class">.field.textField</xsl:param>
        <xsl:param name="errorclass">.field.textField</xsl:param>
        <xsl:param name="showComments">1</xsl:param>
        <xsl:param name="style">width:300 px;</xsl:param>
        <xsl:param name="text">
            <xsl:value-of select="."/>
        </xsl:param>
        <div>
            <xsl:attribute name="class"><xsl:if test="@error">errorfield</xsl:if></xsl:attribute>
            <b>
                <i18n:value>
                    <xsl:value-of select="@title"/>
                </i18n:value>
                <xsl:if test="@error">: </xsl:if>
            </b>
            <xsl:if test="@error">
                <xsl:value-of select="@error"/>
            </xsl:if>
            <br/>
            <input name="{@id}" title="{@comment}" type="file">
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
            </input>
            <br/>
            <xsl:if test="$showComments=1">
                <xsl:value-of select="@comment"/>
            </xsl:if>
        </div>
    </xsl:template>
    <xsl:template match="webform//field[@type='button']" name="drawButtonTemplate">
        <xsl:param name="title" select="@title"/>
        <xsl:param name="class">button</xsl:param>
        <xsl:param name="style"/>
        <div>
            <input class="{$class}" i18n:attr="value" name="{@id}" type="submit" value="{$title}">
                <xsl:if test="$style">
                    <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
                </xsl:if>
            </input>
            <br/>
        </div>
    </xsl:template>
</xsl:stylesheet>
